Fix positioning at the end of the line for lines ending in invisible
authorMatthias Clasen <mclasen@redhat.com>
Tue, 28 Jun 2005 02:46:11 +0000 (02:46 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 28 Jun 2005 02:46:11 +0000 (02:46 +0000)
2005-06-27  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_line_end):
Fix positioning at the end of the line for lines ending
in invisible characters.
(gtk_text_layout_get_line_display): Set display->layout
to a PangoLayout, even for totally invisible lines.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
gtk/gtktextlayout.c

index f06c29e4225b8515913efddc4d2f590c9789bd95..0fd22505f07c9b30f12628f3b72bbdd43bc9c231 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2005-06-27  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_line_end): 
+       Fix positioning at the end of the line for lines ending
+       in invisible characters.
+       (gtk_text_layout_get_line_display): Set display->layout 
+       to a PangoLayout, even for totally invisible lines. 
+
        * gtk/gtkmenushell.c (gtk_menu_shell_grab_broken): Ignore
        GrabBroken events which are caused by overgrabbing inside
        the application; menus rely on these for their operation.
index f06c29e4225b8515913efddc4d2f590c9789bd95..0fd22505f07c9b30f12628f3b72bbdd43bc9c231 100644 (file)
@@ -1,5 +1,11 @@
 2005-06-27  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_line_end): 
+       Fix positioning at the end of the line for lines ending
+       in invisible characters.
+       (gtk_text_layout_get_line_display): Set display->layout 
+       to a PangoLayout, even for totally invisible lines. 
+
        * gtk/gtkmenushell.c (gtk_menu_shell_grab_broken): Ignore
        GrabBroken events which are caused by overgrabbing inside
        the application; menus rely on these for their operation.
index f06c29e4225b8515913efddc4d2f590c9789bd95..0fd22505f07c9b30f12628f3b72bbdd43bc9c231 100644 (file)
@@ -1,5 +1,11 @@
 2005-06-27  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_line_end): 
+       Fix positioning at the end of the line for lines ending
+       in invisible characters.
+       (gtk_text_layout_get_line_display): Set display->layout 
+       to a PangoLayout, even for totally invisible lines. 
+
        * gtk/gtkmenushell.c (gtk_menu_shell_grab_broken): Ignore
        GrabBroken events which are caused by overgrabbing inside
        the application; menus rely on these for their operation.
index a44bf785bedb6e18bfa5b126f742f7263e288b38..3a564c42ba4c6dc2504f3172e3b7de4bff5ff03e 100644 (file)
@@ -1847,7 +1847,14 @@ gtk_text_layout_get_line_display (GtkTextLayout *layout,
    * with sequences of invisible lines.
    */
   if (totally_invisible_line (layout, line, &iter))
-    return display;
+    {
+      if (display->direction == GTK_TEXT_DIR_RTL)
+       display->layout = pango_layout_new (layout->rtl_context);
+      else
+       display->layout = pango_layout_new (layout->ltr_context);
+      
+      return display;
+    }
 
   /* Find the bidi base direction */
   base_dir = line->dir_propagated_forward;
@@ -2955,9 +2962,10 @@ gtk_text_layout_move_iter_to_line_end (GtkTextLayout *layout,
           * are inside a paragraph to avoid going to next line on a
           * forced break not at whitespace. Real fix is to keep track
           * of whether marks are at leading or trailing edge?  */
-          if (direction > 0 && layout_line->length > 0 && !gtk_text_iter_ends_line (iter))
+          if (direction > 0 && layout_line->length > 0 && 
+             !gtk_text_iter_ends_line (iter) && 
+             !_gtk_text_btree_char_is_invisible (iter))
             gtk_text_iter_backward_char (iter);
-
           break;
         }